package org.example.demo21.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.demo21.config.RabbitDelayConfig;
import org.example.demo21.entity.dto.DemoDTO;
import org.example.demo21.entity.po.UserPO;
import org.example.demo21.mapper.UserMapper;
import org.example.demo21.service.RabbitService;
import org.example.demo21.util.RabbitDelayUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 *
 * @author guocong
 * @since 2024/4/22 14:26
 */
@Service
public class RabbitServiceImpl extends ServiceImpl<UserMapper, UserPO> implements RabbitService {

    @Resource
    private RabbitDelayUtil delayUtil;

    @Override
    public Boolean delaySend(DemoDTO dto) {
        return delayUtil.sendDelay(RabbitDelayConfig.DELAYED_ROUTING_KEY, dto, dto.getDelayTime());
    }

}
